using IQIGame.Onigao.GamePlay;

namespace IQIGame.Onigao.Logic
{
    /// <summary>
    /// 执行：接取任务
    /// </summary>
    public class ExecAcceptQuest : BaseServiceExecution
    {
        public override void Execute(LevelRegion region, LevelPlayer player)
        {
            var config = _config as ExecParamAcceptQuest;
            if (config.questCid <= 0)
            {
                LogicLog.LogError($"任务id非法：{config.questCid}");
                return;
            }
            bool isSucces = LogicQuestModule.Instance.AcceptQuest(player.logicPlayer, config.questCid);
            if (!isSucces)
            {
                LogicLog.LogError($"接取任务执行失败：{config.questCid}");
            }
        }
    }
}
